<template>
  <header>
  <img src="../../image/2.jpg" alt="">
  <h1>{{title}}</h1>
  <i class="el-icon-search"></i>
<el-input
  type="text"
  placeholder="请输入内容"
  maxlength="10"
  show-word-limit
>
</el-input>
  <span v-if="bool" @click="Exit">退出登录</span>
  </header>
</template>

<script>
import {mapMutations} from 'vuex'
export default {
  methods:{
    ...mapMutations(['REMOVESTOR']),
    Exit(){
      this.REMOVESTOR();
      this.$router.push('/login');
    }
  },
  props:['title','bool']
}
</script>

<style lang="scss" scoped>
  @import "@/style/mixin.scss";
  header {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    img{
      @include wh(100px,100px);
    }
    h1{
      display: inline-block;
    }
    span{
      cursor: pointer;
      position: absolute;
      right:20px
    }
    i{
      margin-left:100px;
    }
    .el-input{
      width: 200px;
    }

  }
  
</style>